-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove domain parameters #8840
Remove domain parameters #8840
Conversation
24b0bab
to
f5e21e1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me except for a naming issue.
library/psa_crypto_rsa.h
Outdated
@@ -109,6 +109,15 @@ psa_status_t mbedtls_psa_rsa_export_public_key( | |||
* entry point. | |||
* | |||
* \param[in] attributes The attributes for the RSA key to generate. | |||
* \param[in] method Customization parameters for the key |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think later commits in #8815 renamed "method" to "production parameters" so this probably needs updating as well for consistency.
Remove the ability to select a custom public exponent via domain parameters in RSA key generation. The only way to select a custom public exponent is now to pass custom production parameters to psa_generate_key_ext(). A subsequent commit will remove domain parameters altogether from the API, thus this commit does not bother to update the documentation. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Only leave deprecated, minimal non-linkable functions. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
f5e21e1
to
9b97d64
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only left 1 comment, but a part from that this PR looks OK to me.
library/psa_crypto.c
Outdated
@@ -7576,11 +7426,8 @@ psa_status_t psa_generate_key_internal( | |||
* that mbedtls_psa_rsa_generate_key() gets e via a new | |||
* parameter instead. */ | |||
psa_key_attributes_t override_attributes = *attributes; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need to copy this structure? Can't we just pass attributes
to mbedtls_psa_rsa_generate_key()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, duh, yes. And also the comment above is obsolete, that was the whole point of this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing my comments. LGTM :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me except for a possible rebase mistake. Please clarify If this was intentional.
library/psa_crypto.c
Outdated
unlock_status = psa_unregister_read_under_mutex(slot); | ||
|
||
return (status == PSA_SUCCESS) ? unlock_status : status; | ||
return psa_unregister_read(slot); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code this replaces was calling psa_unregister_read_under_mutex()
. Is the change intentional or was it missed during rebase?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rebase mistake. Not caught by testing yet (thanks Ryan), would have caused headaches once the Tsan testing is in place. Thanks for catching it!
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
47ccb55
to
e22f6a9
Compare
ca21b24
Remove domain parameters from the PSA API, since we have an alternative way of choosing a custom public exponent for RSA keys and we don't intend to use them for anything else. Resolve #6495.
Continues #8815, will be rebased once that is merged.
Follow-up: #6496 (started in #7743, but removing domain parameters changing the deal).
PR checklist